package com.it.tydic.estate.module.controller.ckgl;

import com.it.tydic.estate.common.annotation.ControllerDesc;
import com.it.tydic.estate.common.aop.Result;
import com.it.tydic.estate.common.constants.LogConstants;
import com.it.tydic.estate.module.model.inner.TbCkglRkckgl;
import com.it.tydic.estate.module.model.inner.TbCkglWplb;
import com.it.tydic.estate.module.service.WpkcService;
import com.it.tydic.estate.module.service.WplbService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @description:
 * @author: 孟繁炫
 * @createDate: 2020/3/4
 * @version: 1.0
 */
@RestController
@RequestMapping("wpkccx")
@Api(tags = "仓库管理-物品库存查询接口")
public class WpkcController {
    /**
     * 注入接口
     */
    @Autowired
    private WpkcService wpkcService;

    /**
     * 物品库存列表信息
     */
    @PostMapping("/pageList")
    @ApiOperation(value = "物品库存列表信息", notes = "物品库存列表信息")
    public Result pageList(@RequestBody Map<String,Object>map){
        return wpkcService.pageList(map);
    }

    /**
     * 获取列表所需要的下拉框数据
     */
    @GetMapping("/getDataList/{userId}")
    @ApiOperation(value = "获取下拉框数据", notes = "获取下拉框数据")
    public Result pageList(@RequestParam String userId){
        return wpkcService.getDataList(userId);
    }


    /**
     * 单据列表信息查询
     */
    @PostMapping("/danJuPageList")
    @ApiOperation(value = "单据列表信息查询", notes = "单据列表信息查询")
    public Result danJupageList(@RequestBody Map<String,Object>map){
        return wpkcService.danJupageList(map);
    }

    /**
     * 单据明细列表信息查询
     */
    @PostMapping("/MingXiPageList")
    @ApiOperation(value = "单据明细列表信息查询", notes = "单据明细列表信息查询")
    public Result MingXiPageList(@RequestBody Map<String,Object>map){
        return wpkcService.MingXiPageList(map);
    }

    /**
     * 出库入库单据审核
     */
    @PostMapping("/checkByCrkDj")
    @ControllerDesc(description = LogConstants.addOrUpdate_data)
    @ApiOperation(value = "出库入库单据审核", notes = "出库入库单据审核")
    public Result checkByCrkDj(@RequestBody TbCkglRkckgl tbCkglRkckgl){
        return wpkcService.checkByCrkDj(tbCkglRkckgl);
    }
}
